#ifndef TIMEREATER_H
#define TIMEREATER_H

#include <QTimer>
#include <functional>

class TimerEater : public QObject
{
    Q_OBJECT
public:
    explicit TimerEater(std::function<void()> func, int msec,  QObject *parent = nullptr);
    explicit TimerEater(std::function<void()> func, QObject *parent = nullptr);

    void start(int start_delay = 0);

private slots:
    void slotTimeout();

private:
    std::function<void()> m_func;
    QTimer *timer;
};

#endif // TIMEREATER_H
